import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class SysOut {

    public static void write(String filePath, String s) {
        BufferedWriter bw = null;
        try {
            bw = new BufferedWriter(new FileWriter(filePath));
            bw.write(s);
        } catch (IOException e) {
            System.err.println("MyError writing file " + filePath);
        } finally {
            try {
                assert bw != null;
                bw.close();
            } catch (IOException e) {
                System.err.println("MyError writing file " + filePath);
            }
        }
    }
}
